<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/jq.timepicker.addon.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.timepicker.addon.js"></script>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/validator.js"></script>
<script type="text/javascript">
$(function(){
	$(".datepicker").datepicker({dateFormat:'yy-mm-dd',changeMonth:true});
	$(".datepicker_amz").datetimepicker({dateFormat:'yy-mm-dd',changeMonth:true,timeFormat: 'HH:mm'});
	$("#ebay_by_api_one_day_btn").click(function(){
		$("#ebay_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$("#ebay_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#ebay_by_api_form").submit();
	});
	$("#ebay_by_api_two_day_btn").click(function(){
		$("#ebay_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400 * 3)?>");
		$("#ebay_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#ebay_by_api_form").submit();
	});
	$("#ebay_by_api_by_fill_btn").click(function(){
		$(this).attr("disabled", true);
		$("#ebay_by_api_form").submit();
	});
	$("#zencart_by_api_one_day_btn").click(function(){
		$("#zencart_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$("#zencart_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#zencart_by_api_form").submit();
	});
	$("#zencart_by_api_three_day_btn").click(function(){
		$("#zencart_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400 * 3)?>");
		$("#zencart_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#zencart_by_api_form").submit();
	});
	$("#zencart_by_api_one_day_btn").click(function(){
		$(this).attr("disabled", true);
		$("#zencart_by_api_form").submit();
	});
	$("#magento_by_api_one_day_btn").click(function(){
		$("#magento_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$("#magento_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#magento_by_api_form").submit();
	});
	$("#magento_by_api_three_day_btn").click(function(){
		$("#magento_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400 * 3)?>");
		$("#magento_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#magento_by_api_form").submit();
	});
	$("#magento_by_api_one_day_btn").click(function(){
		$(this).attr("disabled", true);
		$("#magento_by_api_form").submit();
	});
	
	$("#amazon_by_api_one_day_btn").click(function(){
		$("#amazon_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$("#amazon_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#amazon_by_api_form").submit();
	});
	$("#amazon_by_api_two_day_btn").click(function(){
		$("#amazon_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400 * 2)?>");
		$("#amazon_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#amazon_by_api_form").submit();
	});
	$("#amazon_by_api_one_day_btn").click(function(){
		$(this).attr("disabled", true);
		$("#amazon_by_api_form").submit();
	});
	$("#amazon2_by_api_one_day_btn").click(function(){
		$("#amazon2_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$("#amazon2_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#amazon2_by_api_form").submit();
	});
	$("#amazon2_by_api_two_day_btn").click(function(){
		$("#amazon2_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400 * 2)?>");
		$("#amazon2_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#amazon2_by_api_form").submit();
	});
	$("#amazon2_by_api_one_day_btn").click(function(){
		$(this).attr("disabled", true);
		$("#amazon2_by_api_form").submit();
	});
	$("#amazon3_by_api_one_day_btn").click(function(){
		$("#amazon3_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$("#amazon3_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#amazon3_by_api_form").submit();
	});
	$("#amazon3_by_api_two_day_btn").click(function(){
		$("#amazon3_by_api_begin_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400 * 2)?>");
		$("#amazon3_by_api_end_sales_time").val("<?=date('Y-m-d', CURRENT_TIMESTAMP - 86400)?>");
		$(this).attr("disabled", true);
		$("#amazon3_by_api_form").submit();
	});
	$("#amazon3_by_api_one_day_btn").click(function(){
		$(this).attr("disabled", true);
		$("#amazon3_by_api_form").submit();
	});
	$("#wish_by_api_by_fill_btn").click(function(){
		$(this).attr("disabled", true);
		$("#wish_by_api_form").submit();
	});
});
</script>
<h3>导入Ebay订单（CSV）</h3>
<form method="post" action="<?=url('Sales::Order/ImportEabyOrderByCsv')?>"  enctype="multipart/form-data" onsubmit="return Validator.Validate(this,3);">
<p>1. 选择店铺
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($ebay_shop as $es):?>
		<option value="<?=$es['id']?>"><?=$es['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择文件<input type="file" name="sales_order"/></p>
<p>3. 导入 <input type="submit" value="导入" class="button" /><input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/></p>
</form>
<br /><br />

<form id="ebay_by_api_form" action="<?=url('Sales::Order/ImportEbayOrderByAPI')?>" method="post">
<h3>导入Ebay订单（API）</h3>
<p>1. 选择店铺
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($ebay_shop as $es):?>
		<option value="<?=$es['id']?>"><?=$es['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择日期
	<input type="text" name="begin_sales_time" class="datepicker" id="ebay_by_api_begin_sales_time" /> to
	<input type="text" name="end_sales_time" class="datepicker" id="ebay_by_api_end_sales_time" />
</p>
<p>3. 导入
	<input type="button" id="ebay_by_api_one_day_btn" value="最近一天" class="button" />
	<input type="button" id="ebay_by_api_two_day_btn" value="最近两天" class="button" />
	<input type="button" id="ebay_by_api_by_fill_btn" value="按填写导入" class="button" />
	<input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/>
</p>
<p>4. 让API飞一会~</p>

</form>
<br /><br />

<h3>导入Zencart订单（API）</h3>
<form id="zencart_by_api_form" action="<?=url('Sales::Order/ImportZencartOrderByAPI')?>" method="post">
<p>1. 选择站点
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($zencart_shop as $zs):?>
		<option value="<?=$zs['id']?>"><?=$zs['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择日期
	<input type="text" name="begin_sales_time" class="datepicker" id="zencart_by_api_begin_sales_time" /> to
	<input type="text" name="end_sales_time" class="datepicker" id="zencart_by_api_end_sales_time" />
</p>
<p>3. 导入
	<input type="button" value="昨天" class="button" id="zencart_by_api_one_day_btn" />
	<input type="button" value="前三天" class="button" id="zencart_by_api_three_day_btn" />
	<input type="submit" value="按日期导入" class="button" id="zencart_by_api_by_fill_btn" />
	<input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/>
</p>
</form>
<br /><br />

<h3>导入Magento订单（API）</h3>
<form id="magento_by_api_form" action="<?=url('Sales::Order/ImportMagentoOrderByAPI')?>" method="post">
<p>1. 选择站点
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($magento_shop as $ms):?>
		<option value="<?=$ms['id']?>"><?=$ms['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择日期
	<input type="text" name="begin_sales_time" class="datepicker" id="magento_by_api_begin_sales_time" /> to
	<input type="text" name="end_sales_time" class="datepicker" id="magento_by_api_end_sales_time" />
</p>
<p>3. 导入
	<input type="button" value="昨天" class="button" id="magento_by_api_one_day_btn" />
	<input type="button" value="前三天" class="button" id="magento_by_api_three_day_btn" />
	<input type="submit" value="按日期导入" class="button" id="magento_by_api_by_fill_btn" />
	<input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/>
</p>
</form>
<br /><br />

<h3>导入Amazon订单（XLSX）</h3>
<form method="post" action="<?=url('Sales::Order/ImportAmazonOrderByXlsx')?>" enctype="multipart/form-data" onsubmit="return Validator.Validate(this,3);">
<p>1. 选择店铺
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($amazon_shop as $as):?>
		<option value="<?=$as['id']?>"><?=$as['name']?></option>
		<?endforeach;?>
		<?foreach ($amazon_shop2 as $es):?>
		<option value="<?=$es['id']?>"><?=$es['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择文件<input type="file" name="sales_order"/></p>
<p>3. 导入 <input type="submit" value="导入" class="button" /><input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/></p>
</form>
<br /><br />

<h3>导入Amazon_US平台订单（API）</h3>
<form id="amazon_by_api_form" action="<?=url('Sales::Order/ImportAmazonOrderByAPI')?>" method="post">
<p>1. 选择店铺
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($amazon_shop as $es):?>
		<option value="<?=$es['id']?>"><?=$es['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 导入日期之后订单 
	<input type="text" name="begin_sales_time" class="datepicker_amz" id="amazon_by_api_begin_sales_time" /> to
	<input type="text" name="end_sales_time" class="datepicker_amz" id="amazon_by_api_end_sales_time" />
</p>
<p>3. 导入
	<input type="button" id="amazon_by_api_one_day_btn" value="最近一天" class="button" />
	<input type="button" id="amazon_by_api_two_day_btn" value="最近两天" class="button" />
	<input type="submit" id="amazon_by_api_by_fill_btn" value="按填写导入" class="button" />
	<input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/>
</p>
<p>4. 让API飞一会~</p>
</form>
<br /><br />

<h3>导入Amazon_EU平台订单（API）</h3>
<form id="amazon2_by_api_form" action="<?=url('Sales::Order/ImportAmazonOrderByAPI')?>" method="post">
<p>1. 选择店铺
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($amazon_shop2 as $es):?>
		<option value="<?=$es['id']?>"><?=$es['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 导入日期之后订单 
	<input type="text" name="begin_sales_time" class="datepicker_amz" id="amazon2_by_api_begin_sales_time" /> to
	<input type="text" name="end_sales_time" class="datepicker_amz" id="amazon2_by_api_end_sales_time" />
</p>
<p>3. 导入
	<input type="button" id="amazon2_by_api_one_day_btn" value="最近一天" class="button" />
	<input type="button" id="amazon2_by_api_two_day_btn" value="最近两天" class="button" />
	<input type="submit" id="amazon2_by_api_by_fill_btn" value="按填写导入" class="button" />
	<input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/>
</p>
<p>4. 让API飞一会~</p>
</form>
<br /><br />

<h3>导入AliExpress订单（API）</h3>
<form action="<?=url('Sales::Order/ImportAliExpressOrderByAPI')?>" method="post">
<p>1. 选择店铺
	<select name="shop_id">
		<option value="">请选择..</option>
		<?foreach ($aliexpress_shop as $as):?>
		<option value="<?=$as['id']?>"><?=$as['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择日期（客人下单时间）
<input type="text" name="begin_sales_time" class="datepicker" /> to
<input type="text" name="end_sales_time" class="datepicker" />
</p>
<p>3. 导入
<input type="submit" value="按照日期导入" class="button" />
<input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/>
</p>	
</form>
<br/><br/>

<h3>导入NewEgg订单（XLS）</h3>
<form method="post" action="<?=url('Sales::Order/ImportNewEggOrderByXls')?>" enctype="multipart/form-data" onsubmit="return Validator.Validate(this,3);">
<p>1. 选择店铺
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($newegg_shop as $ns):?>
		<option value="<?=$ns['id']?>"><?=$ns['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择文件<input type="file" name="sales_order"/></p>
<p>3. 导入 <input type="submit" value="导入" class="button" /><input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/></p>
</form>
<br /><br />

<form id="wish_by_api_form" action="<?=url('Sales::Order/ImportWishOrderByAPI')?>" method="post">
<h3>导入Wish订单（API）</h3>
<p>1. 选择店铺
	<select name="shop_id" dataType="Require" msg="请选择">
		<option value="">请选择...</option>
		<?foreach ($wish_shop as $ws):?>
		<option value="<?=$ws['id']?>"><?=$ws['name']?></option>
		<?endforeach;?>
	</select>
</p>
<p>2. 选择日期
	<input type="text" name="begin_sales_time" class="datepicker" id="wish_by_api_begin_sales_time" /> to today
</p>
<p>3. 导入
	<input type="button" id="wish_by_api_by_fill_btn" value="按填写导入" class="button" />
	<input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/>
</p>
<p>4. 让API飞一会~</p>
</form>

<?php $this->_endblock();?>
